<!--
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/business/productioninspection/ProductionInspection.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/business/productioninspection/ProductionInspection.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Id',
                footer: "Foots",
                cnName: '生产工艺',
                name: 'productioninspection/ProductionInspection',
                url: "/ProductionInspection/",
                sortName: "Id",
                foreignKey:"PIId"
            });
            const editFormFields = ref({"ProductName":"","ProductId":"","ProcessName":"","Sort":"","Description":"","Enable":""});
            const editFormOptions = ref([[{"dataKey":"产品列表","data":[],"title":"产品名称","required":true,"field":"ProductName","type":"select"},
                               {"title":"产品ID","required":true,"field":"ProductId","disabled":true},
                               {"title":"工艺名称","required":true,"field":"ProcessName"}],
                              [{"title":"描述","field":"Description"},
                               {"title":"序号","required":true,"field":"Sort","type":"number"},
                               {"dataKey":"enable","data":[],"title":"是否启用","required":true,"field":"Enable","type":"select"}]]);
            const searchFormFields = ref({});
            const searchFormOptions = ref([]);
            const columns = ref([{field:'Id',title:'主键',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'ProductName',title:'产品名称',type:'string',bind:{ key:'产品列表',data:[]},width:110,require:true,align:'left',sort:true},
                       {field:'ProductId',title:'产品ID',type:'string',width:120,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'ProcessName',title:'工艺名称',type:'string',link:true,width:110,require:true,align:'left'},
                       {field:'Sort',title:'序号',type:'int',width:110,require:true,align:'left'},
                       {field:'Description',title:'描述',type:'string',width:220,align:'left'},
                       {field:'Enable',title:'是否启用',type:'int',bind:{ key:'enable',data:[]},width:110,require:true,align:'left'},
                       {field:'CreateUserName',title:'添加人',type:'string',width:110,align:'left'},
                       {field:'CreateUserId',title:'添加人ID',type:'string',width:110,hidden:true,align:'left'},
                       {field:'CreateDate',title:'添加时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'ModifyUserName',title:'修改人',type:'string',width:110,align:'left'},
                       {field:'ModifyUserId',title:'修改人ID',type:'string',width:110,hidden:true,align:'left'},
                       {field:'ModifyDate',title:'修改时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'DeletionFlag',title:'删除标识',type:'int',width:110,hidden:true,require:true,align:'left'}]);
            const detail = ref({
                cnName: "步骤与投放物料",
                table: "PlacingMaterials",
                columns: [{field:'Id',title:'主键',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'PIId',title:'工艺ID',type:'int',width:110,hidden:true,require:true,align:'left'},
                       {field:'PlacingItemId',title:'投放物品ID',type:'string',width:110,hidden:true,require:true,align:'left'},
                       {field:'PlacingItems',title:'投放物品',type:'string',width:110,require:true,align:'left',sort:true},
                       {field:'PlacementRatio',title:'投放比例',type:'decimal',width:110,hidden:true,edit:{type:''},align:'left'},
                       {field:'UpperLimit',title:'计算上限',type:'decimal',width:110,edit:{type:''},align:'left'},
                       {field:'LowerLimit',title:'计算下限',type:'decimal',width:110,edit:{type:''},align:'left'}],
                sortName: "Id",
                key: "Id"
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
